
/*****************************************************************************
 *
 * 作   者: 马婷婷 * 创建时间: 2020/12/15 15:39:36 *
 * Copyright (C) 2008 - 鹏业软件公司
 *
 *****************************************************************************/

import {DataPacket, NorDataList} from 'pengesoft-ng-lib';

/**
 * 培训安排
 */
export class Train extends DataPacket {
  Id: number; // 序号id
  EmpId: string; // 讲师员工编号
  TrainTheme: string; // 培训主题
  TrainContent: string; // 培训内容
  TrainStartTime: Date | string; // 培训开始时间
  TrainEndTime: Date | string; // 培训截止时间
  TrainPlace: string; // 培训地点
  TrainMaterial: string; // 培训物资
  Remark: string; // 备注

  constructor(options: {
    Id?: number;
    EmpId?: string;
    TrainTheme?: string;
    TrainContent?: string;
    TrainStartTime?: Date | string;
    TrainEndTime?: Date | string;
    TrainPlace?: string;
    TrainMaterial?: string;
    Remark?: string;
  } = {}) {
    super();
    this.Id = !options.Id ? 0 : Number.parseFloat(options.Id.toString());
    this.EmpId = options.EmpId || '';
    this.TrainTheme = options.TrainTheme || '';
    this.TrainContent = options.TrainContent || '';
    this.TrainStartTime = this.newDate(options.TrainStartTime);
    this.TrainEndTime = this.newDate(options.TrainEndTime);
    this.TrainPlace = options.TrainPlace || '';
    this.TrainMaterial = options.TrainMaterial || '';
    this.Remark = options.Remark || '';
  }
}

/**
 * 培训安排列表
 */
export class TrainList extends NorDataList<Train> {

  constructor(options: {
    _Items?: Array<Train>
  } = {}) {
    super();
    if (options._Items) {
      for (const item of options._Items) {
        this.append(new Train(item));
      }
    }
  }
}
